package com.xxgc.eow.service.impl;

import com.xxgc.eow.entity.Skill;
import com.xxgc.eow.entity.Userskill;
import com.xxgc.eow.mapper.UserskillMapper;
import com.xxgc.eow.service.IUserskillService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 * <p>
 * 用户技能表 服务实现类
 * </p>
 *
 * @author Mr.Abel
 * @since 2023-06-04
 */
@Service
public class UserskillServiceImpl extends ServiceImpl<UserskillMapper, Userskill> implements IUserskillService {

    @Resource
    private UserskillMapper userskillMapper;

    @Override
    public List<Skill> getAllSkillByUserId(Integer userId) {
        return userskillMapper.selectAllByUserId(userId);
    }

    @Override
    public Integer deleteAllByUserId(Integer userId) {
        return userskillMapper.deleteByUserId(userId);
    }

    @Override
    public Integer addAll(Integer userId, List<Integer> skillIds) {
        return userskillMapper.insertAll(userId, skillIds);
    }
}
